package com.pactera.madp.daemon.quartz.task;

import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.pactera.madp.common.core.constant.SecurityConstants;
import com.pactera.madp.cp.api.feign.RemoteMarketingEventRemindService;
import com.pactera.madp.daemon.quartz.constant.enums.MadpQuartzEnum;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author zkd
 * @date 2022/5/20 15:09
 */
@Slf4j
@Component("marketingEventRemindTask")
@AllArgsConstructor
public class MarketingEventRemindTask {

    private RemoteMarketingEventRemindService remoteMarketingEventRemindService;

    /**
     * 营销事件提醒发送任务,每天9点执行一次
     * @return
     */
    @SneakyThrows
    public String sendMarketingEventRemindMsg() {
        log.info("执行营销事件提醒任务...");
        remoteMarketingEventRemindService.sendMarketingEventRemindMsg(SecurityConstants.FROM_IN);
        return MadpQuartzEnum.JOB_LOG_STATUS_SUCCESS.getType();
    }
}
